/*
 * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License"),
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef OHOS_DAUDIO_ERRCODE_H
#define OHOS_DAUDIO_ERRCODE_H

namespace OHOS {
namespace DistributedHardware {
enum DAudioErrorCode {
    DH_SUCCESS = 0,
    ERR_DH_AUDIO_BASE = 0x05C40000,
    ERR_DH_AUDIO_NULLPTR = ERR_DH_AUDIO_BASE + 1,
    ERR_DH_AUDIO_FAILED = ERR_DH_AUDIO_BASE + 2,
    ERR_DH_AUDIO_NOT_SUPPORT = ERR_DH_AUDIO_BASE + 3,

    ERR_DH_AUDIO_SA_WRITE_INTERFACE_TOKEN_FAILED = ERR_DH_AUDIO_BASE + 5,
    ERR_DH_AUDIO_SA_WRITE_PARAM_FAIED = ERR_DH_AUDIO_BASE + 6,
    ERR_DH_AUDIO_SA_REGISTERCALLBACK_NOT_FOUND = ERR_DH_AUDIO_BASE + 8,
    ERR_DH_AUDIO_SA_UNREGISTERCALLBACK_NOT_FOUND = ERR_DH_AUDIO_BASE + 9,
    ERR_DH_AUDIO_SA_INVALID_INTERFACE_TOKEN = ERR_DH_AUDIO_BASE + 10,
    ERR_DH_AUDIO_SA_WAIT_TIMEOUT = ERR_DH_AUDIO_BASE + 15,
    ERR_DH_AUDIO_SA_PARAM_INVALID = ERR_DH_AUDIO_BASE + 16,
    ERR_DH_AUDIO_SA_DEVICE_NOT_EXIST = ERR_DH_AUDIO_BASE + 17,
    ERR_DH_AUDIO_SA_PROXY_NOT_INIT = ERR_DH_AUDIO_BASE + 18,
    ERR_DH_AUDIO_SA_LOAD_FAILED = ERR_DH_AUDIO_BASE + 19,
    ERR_DH_AUDIO_SA_STATUS_ERR = ERR_DH_AUDIO_BASE + 20,
    ERR_DH_AUDIO_NOT_FOUND_KEY = ERR_DH_AUDIO_BASE + 21,
    ERR_DH_AUDIO_SA_DEVID_ILLEGAL = ERR_DH_AUDIO_BASE + 22,
    ERR_DH_AUDIO_SA_PERMISSION_FAIED = ERR_DH_AUDIO_BASE + 23,

    // trans error
    ERR_DH_AUDIO_TRANS_ERROR = ERR_DH_AUDIO_BASE + 24,
    ERR_DH_AUDIO_TRANS_ILLEGAL_OPERATION = ERR_DH_AUDIO_BASE + 26,
    ERR_DH_AUDIO_TRANS_SESSION_NOT_OPEN = ERR_DH_AUDIO_BASE + 27,

    // codec error
    ERR_DH_AUDIO_BAD_VALUE = ERR_DH_AUDIO_BASE + 28,
    ERR_DH_AUDIO_BAD_OPERATE = ERR_DH_AUDIO_BASE + 29,
    ERR_DH_AUDIO_CODEC_CONFIG = ERR_DH_AUDIO_BASE + 30,
    ERR_DH_AUDIO_CODEC_START = ERR_DH_AUDIO_BASE + 31,
    ERR_DH_AUDIO_CODEC_STOP = ERR_DH_AUDIO_BASE + 32,
    ERR_DH_AUDIO_CODEC_RELEASE = ERR_DH_AUDIO_BASE + 33,
    ERR_DH_AUDIO_CODEC_INPUT = ERR_DH_AUDIO_BASE + 34,

    // spk client error
    ERR_DH_AUDIO_CLIENT_PARAM_ERROR = ERR_DH_AUDIO_BASE + 35,
    ERR_DH_AUDIO_CLIENT_RENDER_CREATE_FAILED = ERR_DH_AUDIO_BASE + 36,
    ERR_DH_AUDIO_CLIENT_RENDER_STARTUP_FAILURE = ERR_DH_AUDIO_BASE + 37,
    ERR_DH_AUDIO_CLIENT_RENDER_STOP_FAILED = ERR_DH_AUDIO_BASE + 38,
    ERR_DH_AUDIO_CLIENT_RENDER_RELEASE_FAILED = ERR_DH_AUDIO_BASE + 39,
    ERR_DH_AUDIO_CLIENT_SET_VOLUME_FAILED = ERR_DH_AUDIO_BASE + 40,
    ERR_DH_AUDIO_CLIENT_SET_MUTE_FAILED = ERR_DH_AUDIO_BASE + 41,

    // mic client error
    ERR_DH_AUDIO_CLIENT_CAPTURER_CREATE_FAILED = ERR_DH_AUDIO_BASE + 42,
    ERR_DH_AUDIO_CLIENT_CAPTURER_START_FAILED = ERR_DH_AUDIO_BASE + 43,

    // other error
    ERR_DH_AUDIO_HDI_CALL_FAILED = ERR_DH_AUDIO_BASE + 44,
    ERR_DH_AUDIO_HDI_INVALID_PARAM = ERR_DH_AUDIO_BASE + 45,
    ERR_DH_AV_TRANS_CREATE_CHANNEL_FAILED = ERR_DH_AUDIO_BASE + 46,
    ERR_DH_AUDIO_ACCESS_PERMISSION_CHECK_FAIL = ERR_DH_AUDIO_BASE + 47,
};
} // namespace DistributedHardware
} // namespace OHOS
#endif // OHOS_DAUDIO_ERRCODE_H
